package com.any.hook.core.webapi.service;


import com.any.hook.core.webapi.entity.DBInfo;
import com.any.hook.core.webapi.mapper.DbInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EtlDBService {
    @Autowired
    private DbInfoMapper dbInfoMapper;
    public int saveDBInfo(DBInfo dbInfo){
        return dbInfoMapper.insertInfo(dbInfo);
    }
    public List<DBInfo> getAllDBInfo(int page,int size){
        int skipCount=(page-1)*size;
        return dbInfoMapper.queryAll(skipCount,size);}
    public int findName(String name){return dbInfoMapper.queryName(name);}
    public DBInfo findByName(String name){return dbInfoMapper.queryByName(name);}
    public int deleteByName(String name){return dbInfoMapper.deleteByName(name);}
    public int updateByName(DBInfo dbInfo){
        return dbInfoMapper.updateInfo(dbInfo);
    }
    public int selectCount(){
        return dbInfoMapper.selectCount();
    }
}

